﻿using log4net;
using NpgsqlTypes;
using PcaCore.BOL.Tablas;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace PcaCore.DAL.Tablas
{
    public class dTZonaHoraria
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(dTZonaHoraria));

        #region Public

        public static oTZonaHoraria Get(int zonaHorariaId)
        {
            try
            {
                return Core.GetObjectDb<oTZonaHoraria>("pca_tablas.fn_get_zona_horaria",
                                                        new oParametro(NpgsqlDbType.Integer, zonaHorariaId));
            }
            catch (Exception ex)
            {
                throw Core.LogException(log, ex, MethodBase.GetCurrentMethod().Name);
            }
        }
        
        public static List<oTZonaHoraria> GetList(string filtro)
        {
            try
            {
                return Core.GetListObjecstDb<oTZonaHoraria>("pca_tablas.fn_get_list_zonas",
                                                           new oParametro(NpgsqlDbType.Varchar, filtro));
            }
            catch (Exception ex)
            {
                throw Core.LogException(log, ex, MethodBase.GetCurrentMethod().Name);
            }
        }

        #endregion
    }
}
